<%--
  Created by IntelliJ IDEA.
  User: asus
  Date: 2023/4/24
  Time: 10:03
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title></title>
    <link href="CSS/Style1.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="Scripts/jquery-3.1.1.js"></script>
    <script>
        $(function () {
            $("[name='deleteur']").click(function () {
                let thisa = $(this);
                let id = $(this).prop("id");
                $.ajax({
                    url:'deletetypeBystId?id='+id,
                    success:function (data) {
                        if(data==1){//删除成功
                            thisa.parent().parent().remove();
                        }
                    }
                })
            })
        })
    </script>
</head>
<body>
<div id="desDiv">
    <span>服务管理</span><br />
    管理系统中所有的服务处理类型
</div>
<div id="dataDiv">
    <table class="dataTable" style="width:50%;text-align: center;">
        <tr>
            <th>编号</th>
            <th>类型名</th>
            <th>操作</th>
        </tr>
        <c:forEach items="${typeList}" var="type">
        <tr>
            <td>${type.stid}</td>
            <td>${type.stname}</td>
            <td>
                <a href="#">修改</a>
                <a href="#" name="deleteur" id="${type.stid}">删除</a>
            </td>
        </tr>
        </c:forEach>
<%--        <tr>--%>
<%--            <td>2</td>--%>
<%--            <td>投诉</td>--%>
<%--            <td>--%>
<%--                <a href="#">修改</a>--%>
<%--                <a href="#">删除</a>--%>
<%--            </td>--%>
<%--        </tr>--%>
<%--        <tr>--%>
<%--            <td>3</td>--%>
<%--            <td>投诉</td>--%>
<%--            <td>--%>
<%--                <a href="#">修改</a>--%>
<%--                <a href="#">删除</a>--%>
<%--            </td>--%>
<%--        </tr>--%>
    </table>
</div>

<div id="dataDiv">
    <form action="addnewService" method="get">
    <table class="tableEdit" style="width:50%;">
        <thead>
        <tr>
            <td colspan="2">添加服务类型</td>
        </tr>
        </thead>
        <tr>
            <td>服务名：</td>
            <td>
                <input type="text" name="stname" value="" />
            </td>
        </tr>
        <tfoot>
        <tr>
            <td colspan="2">
                <input type="submit" value="确定" />&nbsp;&nbsp;
                <input type="button" value="关闭" onclick="window.close()" />
            </td>
        </tr>
        </tfoot>
    </table>
    </form>
</div>
</body>
</html>
